import Vue from "vue";
import Router from "vue-router";
import Film from "../views/Film.vue";
import nowPlaying from "../views/nowPlaying.vue";
import comingSoon from "../views/comingSoon.vue";
import Center from "../views/Center.vue";
import Cinema from "../views/Cinema.vue";
import City from "../views/City.vue";
import cinemaDetail from "../views/cinemaDetail.vue";
import cinemaSearch from "../views/cinemaSearch.vue";
import Login from "../views/Login.vue";
import Detail from "../views/Detail.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/film"
    },
    {
      path: "/film",
      component: Film,
      meta: {
        isShowTabbar: true
      },
      children: [
        {
          path: "/",
          redirect: "/film/nowPlaying"
        },
        {
          path: "nowPlaying",
          component: nowPlaying,
          meta: {
            isShowTabbar: true
          }
        },
        {
          path: "comingsoon",
          component: comingSoon,
          meta: {
            isShowTabbar: true
          }
        }
      ]
    },
    {
      path: "/cinema",
      component: Cinema,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/center",
      component: Center,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/city",
      component: City,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/cinema/search",
      component: cinemaSearch,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/cinemadetail/:id",
      component: cinemaDetail,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/login",
      component: Login,
      meta: {
        isShowTabbar: true
      }
    },
    {
      path: "/detail/:myid",
      component: Detail,
      meta: {
        isShowTabbar: true
      }
    }
  ]
});
